home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Tools - Objects / C++ / MPW C++ 3.1b1 / Examples / CPlusExamples / StreamCounter.h < prev    next >
Text File  |  1989-09-29  |  330b  |  28 lines

  1. #ifndef        TStreamCounter_H
  2. #define        TStreamCounter_H
  3.  
  4. #include <Stream.h>
  5.  
  6. struct aCount {
  7.     long    chars;
  8.     long    lines;
  9. };
  10.  
  11. class TStreamCounter {
  12.  
  13.   public:
  14.  
  15.     TStreamCounter(fstream* =0);
  16.         
  17.     void    Reset(fstream* =0);
  18.     void    Count();
  19.     aCount    GetCount() { return fCount; };
  20.  
  21.   private:
  22.     
  23.     fstream*    fStream;
  24.     aCount        fCount;
  25. };
  26.  
  27.     
  28. #endif